package com.example.statemachine.util;

import lombok.Data;

/**
 * @author jianwei.wang
 * @version v1.0
 * @date 2019/5/9 16:41
 **/
@Data
public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 3636470489471788744L;

    private Integer code;
    private String message;

    public BusinessException(String message) {
        super(message);
        this.message=message;
    }
    public BusinessException(int code,String message) {
        this.code=code;
        this.message=message;
    }

    public static BusinessException paramException(){
        return new BusinessException("参数异常");
    }

    public static BusinessException stateException(Integer code,String message){
        return new BusinessException(code,message);
    }
    public static BusinessException stateException(){
        return new BusinessException("当前数据已变更，请刷新重试...");
    }
}
